http://jsfiddle.net/skram/XNFJD/